package com.arvato.admin01.controller;

import com.arvato.admin01.Util.AopLogger;
import com.arvato.admin01.Util.AutoIdempotent;
import com.arvato.admin01.constant.ServerResponse;
import com.arvato.admin01.service.token.TestService;
import com.arvato.admin01.service.token.TokenService;
import com.itextpdf.text.pdf.AcroFields;
import com.itextpdf.text.pdf.BaseFont;
import com.itextpdf.text.pdf.PdfReader;
import com.itextpdf.text.pdf.PdfStamper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("/test")
@Api(tags = {"用户管理"}, description = "用户管理")
public class TestController {

    @Autowired
    private TokenService tokenService;
    @Autowired
    private TestService testService;
    @GetMapping("/token")
    public ServerResponse token() {
        return tokenService.createToken();
    }



    @AutoIdempotent
    @PostMapping("testIdempotence")
    public ServerResponse testIdempotence() {
        return testService.testIdempotence();
    }

     @GetMapping("/demo")
     @ApiOperation(value = "添加用户")
     @AopLogger(describe = "添加用户")
     public String helloWorld(String name){
            return "Hello：" + name;
        }

}
